package org.zero.consumer.client;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.zero.producer.api.ProducerClient;

@Component
public class ProducerClientFallbackFactory implements FallbackFactory<ProducerClient> {

    @Override
    public ProducerClient create(Throwable throwable) {
        return new ProducerClient() {
            @Override
            public String consumer(String name) {
                return "发生异常:" + name;
            }
        };
    }
}